var name = 'why'


foo(345)

function foo(num) {
  console.log('num=' + num);
  console.log('m=' + m);
  var m = 10;
  var n = 20;

  // var name = 'foo'

  console.log(name);


}

// 当我们查找一个变量时,真实的查找路径是沿着作用域链来查找 scope chian: VO + ParentScope(AO + GO)

var globalObject = {
  String: '类',
  // ...
  window: globalObject,
  name: undefined,
  foo: '内存中开辟的空间的内存地址'
}